<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">
        <fieldset class="table-search-fieldset">
            <legend>APP设置</legend>
            <div>
                <form class="layui-form layui-form-pane" lay-filter="appset">
                    <div class="layui-form-item">
                        <label class="layui-form-label">软件名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="appname" autocomplete="off" placeholder="请输入软件名称"
                                class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">软件版本名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="appvname" autocomplete="off" placeholder="请输入软件版本名称"
                                class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">软件版本号</label>
                        <div class="layui-input-block">
                            <input type="text" name="appv" lay-verify="title" autocomplete="off" placeholder="请输入软件版本号"
                                class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">更新地址</label>
                        <div class="layui-input-block">
                            <input type="text" name="appupurl" lay-verify="title" autocomplete="off"
                                placeholder="请输入更新地址" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">更新公告</label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入更新公告" name="appupgg" class="layui-textarea"></textarea>
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">弹出消息</label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入弹出消息" name="appgg" class="layui-textarea"></textarea>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">软件模式</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="askapp" lay-skin="switch" lay-text="开启|关闭">
                        </div>
                        <div class="layui-form-mid layui-word-aux">开启后仅支持软件访问</div>
                    </div>

                    <div class="layui-form-item">
                        <button type="button" class="layui-btn" lay-submit="" lay-filter="appset">保存</button>
                    </div>
                </form>
            </div>
        </fieldset>
    </div>


</div>

<script>
    layui.use(['form', 'lycms'], function () {
        var form = layui.form
            , layer = layui.layer
            , lycms = layui.lycms;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        //监听提交
        form.on('submit(appset)', function (data) {
            lycms.appsetOperate(data);
            return false;
        });

        // 页面初始化
        $(document).ready(function () {
            //获取初始信息
            $.post("/v1/admin/data/appset", function (data, status) {
                //表单初始赋值
                form.val('appset', data);
            });
        });
    });
</script>